//
//  QYOrderDetailBookCell.m
//  QingYue
//
//  Created by Zheng on 2019/3/28.
//  Copyright © 2019 com.lanou.product_A. All rights reserved.
//

#import "QYOrderDetailBookCell.h"

@implementation QYOrderDetailBookCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        UIView *bgView = [[UIView alloc] init];
        bgView.layer.masksToBounds = YES;
        bgView.layer.cornerRadius = 5;
        bgView.layer.borderColor = [UIColor lightGrayColor].CGColor;
        bgView.layer.borderWidth = 0.5;
        [self.contentView addSubview:bgView];
        [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(12);
            make.width.height.mas_equalTo(40);
            make.centerY.equalTo(self);
        }];

        _bookImgv = [[UIImageView alloc] init];
        _bookImgv.image = [UIImage imageNamed:@"图书占位.jpg"];
        [bgView addSubview:_bookImgv];
        [_bookImgv mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(30);
            make.height.mas_equalTo(35);
            make.center.offset(0);
        }];
        
        _bookNameLbl = [[UILabel alloc] init];
        [self.contentView addSubview:_bookNameLbl];
        [_bookNameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.bookImgv.mas_right).offset(15);
            make.centerY.equalTo(self.bookImgv);
            make.right.mas_equalTo(-80);
        }];
        
        _statusLbl = [[UILabel alloc] init];
        _statusLbl.textColor = MyGreenColor;
        _statusLbl.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_statusLbl];
        [_statusLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self.bookImgv);
        }];
        
    }
    return self;
}

@end
